package com.wn.pojo;

import javax.validation.constraints.*;
import java.util.Date;

public class User {
    private Integer id;

    @Pattern(regexp = "^\\w{3,10}$", message = "账号必须为大小写字母组成，长度为3到10位")
    private String account;
    @Size(min = 5, max = 10, message = "密码长度必须大于 5 个字符小于10个字符")
    private String password;
    @Size(min = 1, max = 6, message = "真实姓名长度必须在1到6之间")
    private String realName;
    @Max(value = 150,message = "年龄只能是1到150岁")
    @Min(value = 1,message = "年龄只能是1到150岁")
    private Integer age;
    @NotBlank(message = "性别不能为空")
    private String gender;

    private String description;

    private Integer roleId;

    private Integer postId;

    private Integer createUserId;

    private Date createTime;

    private Integer updateUserId;

    private Date updateTime;

    private Integer isDeleted;
    @NotBlank(message = "手机号不能为空")
    private String telephone;

    private Integer status;

    public User(Integer id, String account, String password, String realName, Integer age, String gender, String description, Integer roleId, Integer postId, Integer createUserId, Date createTime, Integer updateUserId, Date updateTime, Integer isDeleted, String telephone, Integer status) {
        this.id = id;
        this.account = account;
        this.password = password;
        this.realName = realName;
        this.age = age;
        this.gender = gender;
        this.description = description;
        this.roleId = roleId;
        this.postId = postId;
        this.createUserId = createUserId;
        this.createTime = createTime;
        this.updateUserId = updateUserId;
        this.updateTime = updateTime;
        this.isDeleted = isDeleted;
        this.telephone = telephone;
        this.status = status;
    }

    public User() {
        super();
    }

    public User(Integer id, String account) {
        this.id = id;
        this.account = account;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account == null ? null : account.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName == null ? null : realName.trim();
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender == null ? null : gender.trim();
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description == null ? null : description.trim();
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public Integer getPostId() {
        return postId;
    }

    public void setPostId(Integer postId) {
        this.postId = postId;
    }

    public Integer getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Integer createUserId) {
        this.createUserId = createUserId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateUserId(Integer updateUserId) {
        this.updateUserId = updateUserId;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone == null ? null : telephone.trim();
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}